//
//  CAnAlgSwimLapData+Desc.m
//  CareRing
//
//  Created  on 2024/12/14.
//
    
#import <DateTools/DateTools.h>
#import "CAnAlgSwimLapData+Desc.h"
#import "ConfigModel.h"
@implementation CAnAlgSwimLapData (Desc)
-(NSString *)wholeDesc
{

    NSMutableString *infoString = [NSMutableString new];

    NSDate *date = [NSDate dateWithTimeIntervalSince1970:self.timeStamp];
    
    [infoString appendFormat:@"Date:%@, ", [date formattedDateWithFormat:_L2(L_DATE_FMT)]];
    
    [infoString appendFormat:@"%@, ", self.swimStyleDesc];
    [infoString appendFormat:@"Strokes:%u, ", self.strokes];

    [infoString appendFormat:@"Lap SwimDuration:%u s, ", self.lapSwimDuration];

    [infoString appendFormat:@"StrokeRate:%u m, ", self.strokeRate];

    [infoString appendFormat:@"Swim pace:%u min/Km *10, ", self.lapSwimPace];

    [infoString appendFormat:@"Swolf:%u, ", self.swolf];

    [infoString appendFormat:@"Lap DetectionStatus:%u , ", self.lapDetectionStatus];
    [infoString appendFormat:@"Lap Distance:%u , ", self.lapDistance];


    
    return infoString;
    
}

-(NSString *)swimStyleDesc
{
    NSString *str = @"";
    switch (self.swimStylePerLap) {
        case NALG_SWIM_UKNOW :
        {
            str = @"Unknow";
        }
            break;
        case NALG_SWIM_CRAWLING : // 爬泳
        {
            str = @"crawl";
        }
            break;
        case NALG_SWIM_BREASTSTROKE : // 蛙泳
        {
            str = @"breaststroke";
        }
            break;
        case  NALG_SWIM_BACKSTROKE : //仰泳
        {
            str = @"Backstroke";
        }
            break;
        case NALG_SWIM_BUTTERFLY : // 蝶泳
        {
            str = @"Butterfly stroke";
        }
            break;
        default:
            break;
    }
    
    return str;
}
@end
